from lib.w.glade import *
from lib.carro import *

import gobject

gobject.threads_init()

class Posto(GladeWidget):

	def __init__(self):
		
		self.qtde_carro = 5

		self.carro_list = []
			
		self.initialize("glade/posto.glade", "posto")

		gtk.main()

	def run(self, *args):

		# Cria os carros
		for i in range(self.qtde_carro):
			C = Carro(self.w.mundo)
			self.carro_list.append(C)
			#C.start()

	def quit(self, *args):

		for carro in self.carro_list:
			carro.sair = True
		self.w._top.destroy()
		gtk.main_quit()

if __name__ == '__main__':
	Posto()
